package cn.acewill.yxd.yunxundian.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import org.w3c.dom.Text;

import java.util.List;

import cn.acewill.yxd.yunxundian.BaseActivity;
import cn.acewill.yxd.yunxundian.R;
import cn.acewill.yxd.yunxundian.model.RMain;

/**
 * Created by xxx on 2018/1/17.
 */

public class EvaMajorItemSelectAdapter extends BaseAdapter{
    private Context context;
    private List<RMain.TablesBean.Q1Bean> q1BeanList;
    public EvaMajorItemSelectAdapter(Context context,List<RMain.TablesBean.Q1Bean> q1BeanList){
        this.context = context;
        this.q1BeanList = q1BeanList;
    }
    @Override
    public int getCount() {
        return q1BeanList!=null?q1BeanList.size():0;
    }

    @Override
    public Object getItem(int position) {
        return q1BeanList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent){
           ViewHolder holder;
        if (convertView == null){
            convertView = LayoutInflater.from(context).inflate(R.layout.item_sore_select,parent,false);
            holder = new ViewHolder();
            holder.itemName = (TextView) convertView.findViewById(R.id.itemScore);
            convertView.setTag(holder);
        }else{
            holder = (ViewHolder) convertView.getTag();
        }
        RMain.TablesBean.Q1Bean q1 = q1BeanList.get(position);
        holder.itemName.setText(q1.getReportTableName());
        return convertView;
    }
    class ViewHolder{
        TextView itemName;
    }
}
